import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

async def main():
    params = StdioServerParameters(command="python3", args=["-m", "mcp_openeuler_server.server"]) 
    async with stdio_client(params) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            tools = await session.list_tools()
            print("Tools:", [t.name for t in tools.tools])

            res = await session.call_tool("system_stats", {})
            print("Stats content blocks:", res.content)
            print("Structured:", res.structuredContent)

if __name__ == "__main__":
    asyncio.run(main())

